package com.sau.pixelcart.controller;


import com.sau.pixelcart.common.result.PageResult;
import com.sau.pixelcart.common.result.Result;
import com.sau.pixelcart.domain.dto.InventoryPageDTO;
import com.sau.pixelcart.domain.vo.InventoryAdjustmentVO;
import com.sau.pixelcart.service.IInventoryAdjustmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 库存操作审计表 前端控制器
 * </p>
 *
 * @author Inton
 * @since 2025-03-08
 */
@Slf4j
@RestController
@RequestMapping("/inventory/adjustment")
public class InventoryAdjustmentController {

    @Autowired
    private IInventoryAdjustmentService inventoryAdjustmentService;

    /**
     * 库存操作记录
     * @param inventoryPageDTO
     * @return
     */
    @PostMapping("/list")
    public Result list(@RequestBody InventoryPageDTO inventoryPageDTO){
        log.info("库存操作记录查询：{}", inventoryPageDTO);
        PageResult<InventoryAdjustmentVO> pageResult = inventoryAdjustmentService.pageQuery(inventoryPageDTO);
        return Result.success(pageResult);
    }
}
